/* Copyright (C) 2008 Sahid Ferdjaoui <sahid@funraill.org>
 *
 *   This file is part of Postmemd.
 *
 * Postmemd is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */


#ifndef PM_POOL_H
#define PM_POOL_H


/**
 * @file pm_slaves.h
 * @brief Postmem slaves
 */


struct slave_hub {
	pid_t    pid;
	size_t   size;

	pfd_t     in;
	pfd_t     out;

	int       cmd;

	ev_io									event;
	struct ev_loop			*	loop;
};

struct pool_slaves {
	
	struct slave * first;
	struct slave * curr;
	struct slave * last;

	size_t size;
};


typedef struct slave_hub       hub_t;
typedef struct pool_slaves     pool_slaves_t;


extern pool_slaves_t * pool;



#endif
